package com.h3c.ptability.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.h3c.ptability.bo.ElectronicSignBO;
import com.h3c.ptability.dto.EditWaitSignTimeDTO;
import com.h3c.ptability.dto.PtWaitSignInfoDTO;
import com.h3c.ptability.entity.PtWaitSignInfo;
import com.h3c.ptability.support.event.EventElement;
import com.h3c.ptability.vo.PtWaitSignInfoVO;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 接口类
 *
 * @author chenyifan
 * @since 2022-10-20 15:08:04
 */
public interface IPtWaitSignInfoService extends IService<PtWaitSignInfo> {

    /**
     * 导入excel保存待发起签署的信息
     *  @param file 导入文件
     * @param sceneId
     * @param appId
     */
    void parseFileAndSaveWaitSign(MultipartFile file, String sceneId, String appId);

    /**
     * 判断是否是待发起
     *
     * @param workerId  员工id
     * @param sceneType 场景类型
     * @return
     */
    Boolean judgeIfWaitSign(String workerId, String sceneType);

    /**
     * 等待签署的发起签署
     *
     * @param electronicSignBO
     * @param isRetry
     * @throws Exception
     */
    void signWaitForMan(ElectronicSignBO electronicSignBO, Boolean isRetry) throws Exception;

    /**
     * 填充RecordId
     *
     * @param eventElement 事件元素
     */
    void fillRecordId(EventElement eventElement);

    /**
     * 修改开始和结束签署时间
     *
     * @param editWaitSignTimeDTO
     */
    void editWaitSignTime(EditWaitSignTimeDTO editWaitSignTimeDTO);

    /**
     * 分页查询待签署名单信息
     * @param waitSignInfoDTO
     * @param currentPage
     * @param pageSize
     * @return
     */
    IPage<PtWaitSignInfoVO> pageWaitSignInfo(PtWaitSignInfoDTO waitSignInfoDTO, Integer currentPage, Integer pageSize);

    /**
     * 下载记录
     * @param signInfoDTO
     * @param response
     */
    void downloadRecord(PtWaitSignInfoDTO signInfoDTO, HttpServletResponse response);

    /**
     * 使用导入名单的信息对待签署的发起签署
     * @param idList
     * @param appId
     * @throws Exception
     */
    void signExcelInfoWaitForMan(List<String> idList, String appId) throws Exception;
}

